package lambda;

import org.junit.Test;

import java.util.*;
import java.util.function.Supplier;

public class Demo1 {
    @Test
    public void test01() {
        //匿名内部类
        Comparator<Integer> comparator = new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return Integer.compare(o1, o2);
            }

            @Override
            public boolean equals(Object obj) {
                return false;
            }
        };
        //调用
        TreeSet<Integer> set = new TreeSet<>(comparator);
    }

    @Test
    public void test02() {
        List<Integer> list = new ArrayList<>();
        List<Integer> integers = Arrays.asList(1, 2, 3);
        list.addAll(integers);
        list.forEach(a->{

        });
    }
}
